package com.song.su.controller;

import com.song.su.mapper.BookDetailMapper;
import com.song.su.model.BookDetail;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class ListController {
    @Autowired
    BookDetailMapper bookDetailMapper;


    @GetMapping("/list")
    public String List(Model model){
        List<BookDetail>  bookDetails = bookDetailMapper.findAll();
        model.addAttribute("bookDetails",bookDetails);

        return "list";
    }
}
